<?php

namespace App\Models;


use Illuminate\Database\Eloquent\Model;

class CarPackageUsedLog extends Model
{
	
    protected $table = 'car_package_used_logs';

    protected $fillable = [
        'user_id',
        'order_id',
        'attr_id',
        'package_id',
        'package_title',
        'package_pic',
        'attr_title',
        'used_at',
        'store_id',
        'operator_user_id',
        'operator_pics',
        'operator_at',
        'car_number',
        'remarks',
        'status',
        'admin_user_id'
    ];

    public function order()
    {
        return $this->belongsTo(CarPackageOrder::class);
    }

    public function package()
    {
        return $this->belongsTo(CarPackage::class);
    }

    public function store()
    {
        return $this->belongsTo(Store::class);
    }

    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function operator()
    {
        return $this->belongsTo(User::class, 'operator_user_id');
    }

    public function attr()
    {
        return $this->belongsTo(CarPackageOrderAttr::class);
    }
}
